This is the replication file for BJPS paper "When Reelection Increases Party Unity: Evidence from Parties in Mexico"
Author: Lucia Motolinia (WUSTL, email: luciam@wustl.edu)

The analysis in the paper is based on votes and speech patterns.

*Votes
-Please see dofile replication_votes
	-Lines 13 to 3668 provide the code to calculate the proportion that a legislator votes with their party leader each month.
	These are calculated from the csv files in folders csv_01 and csv_02 (these correspond to the first and second legislature in the analysis for each state)
	-votes_m is the working file that stores the proportions
	-Runing this produces the analysis file votes_clean.dta (also provided)
-Main Paper Analysis uses votes_clean.dta and begins in line 3670 of replication_votes.do
-Appendix Analysis begins in line 3828
	-allvotesraw.dta is necessary to perform robustness check in Supp. Appendix Section A6

*Speeches
-Please see dofile replication_speeches
-File correspondance.dta contains the results from the correspondance analysis from raw text. Please note that the speech files occupy significant space, if you want them please contact me at luciam@wustl and we can arrange a data transfer.
-Main Paper Analysis uses and begins in line 41 of replication_speeches.do
-Appendix Analysis begins in line 230 
	-speak.dta is necessary to perform robustness check in Supp. Appendix Section A12.1
	-leg_covariates.dta is necessary to perform robustness check in Supp. Appendix Section A10
	-state_corr_mc.dta is necessary to perform robustness check in Supp. Appendix Section A7
